/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.softace.jdbc.test.beans;

import com.softace.jdbc.annotations.JdbcAttribute;
import com.softace.jdbc.annotations.JdbcAttributeObject;
import com.softace.jdbc.annotations.JdbcEntity;

/**
 *
 * @author S!LENT W@RRIOR
 */
@JdbcEntity(tableName = "student")
public class StudentBean {

    @JdbcAttribute(columnName = "student_id", isKeyForMap = true)
    private int studentId;
    @JdbcAttribute(columnName = "student_name")
    private String studentName;
    @JdbcAttribute(columnName = "semester")
    private int semester;
    @JdbcAttributeObject(tableName = "degree", keyColumnName = "degree_id", tableClass = DegreeBean.class)
    private DegreeBean degree;

    /**
     * The default constructor
     */
    public StudentBean() {
    }

    /**
     * Another constructor!
     *
     * @param studentId the student id
     * @param studentName the student name
     * @param semester the semester number
     * @param degree Student's Degree
     */
    public StudentBean(int studentId, String studentName, int semester, DegreeBean degree) {
        this.studentId = studentId;
        this.studentName = studentName;
        this.semester = semester;
        this.degree = degree;
    }

    /**
     * Retrieves the student id
     *
     * @return the student id
     */
    public int getStudentId() {
        return studentId;
    }

    /**
     * Sets the id of the student
     *
     * @param studentId the new student id
     */
    public void setStudentId(int studentId) {
        this.studentId = studentId;
    }

    /**
     * Gets the name of the student
     *
     * @return the student name
     */
    public String getStudentName() {
        return studentName;
    }

    /**
     * Sets the name of the student
     *
     * @param studentName the student name
     */
    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    /**
     * Retrieves the student's semester number
     *
     * @return semester number
     */
    public int getSemester() {
        return semester;
    }

    /**
     * Sets the semester number for the designated student
     *
     * @param semester new semester number
     */
    public void setSemester(int semester) {
        this.semester = semester;
    }

    /**
     * Gets the degree of the student
     *
     * @return the degree
     */
    public DegreeBean getDegree() {
        return degree;
    }

    /**
     * Sets the degree of the student
     *
     * @param degree the new degree
     */
    public void setDegree(DegreeBean degree) {
        this.degree = degree;
    }

    @Override
    public String toString() {
        return "StudentBean{" + "studentId=" + studentId
                + ", studentName=" + studentName
                + ", semester=" + semester
                + ", degree=" + degree + '}';
    }
}
